<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>游戏房间</title>
  <link rel="stylesheet" href="css/common.css">
  <!-- 添加字体图标库 -->
  <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
  <style>

    .nav {
      background-color: rgba(255, 255, 255, 0.9);
      padding: 15px 0;
      margin-top: -25px;  /* 进一步上移 */
      margin-left: -20px;  /* 增加负边距确保左边显示完整 */
      margin-right: -20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      font-size: 24px;
      font-weight: bold;
      color: #333;
      position: relative;
      width: calc(100% + 40px);  /* 相应调整宽度 */
      text-align: center;  /* 确保文字居中 */
    }

    .container {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
      margin-top: 20px;
    }

    .game-container {
      background: rgba(255, 255, 255, 0.9);
      padding: 20px;
      border-radius: 15px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
      transition: transform 0.3s ease;
    }

    .game-container:hover {
      transform: translateY(-5px);
    }

    #chess {
      border-radius: 10px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
      background: #f5f5f5;
      margin-bottom: 15px;
    }

    #screen {
      width: 450px;
      height: 50px;
      margin-top: 15px;
      background-color: rgba(255, 255, 255, 0.8);
      font-size: 20px;
      line-height: 50px;
      text-align: center;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
      color: #666;
      transition: all 0.3s ease;
    }

    /* 添加等待动画 */
    @keyframes dots {
      0%, 20% { content: '.'; }
      40% { content: '..'; }
      60% { content: '...'; }
      80%, 100% { content: ''; }
    }

    #screen::after {
      content: '';
      animation: dots 1.5s infinite;
    }

    /* 添加响应式设计 */
    @media (max-width: 500px) {
      .game-container {
        padding: 10px;
      }

      #chess, #screen {
        width: 100%;
        max-width: 450px;
      }
    }

    .back-button {
      margin-top: 15px;
      padding: 10px 25px;
      font-size: 16px;
      color: #fff;
      background: linear-gradient(145deg, #6a89cc, #4a69bd);
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(74, 105, 189, 0.3);
      font-weight: 500;
      display: block;
      margin-left: auto;
      margin-right: auto;
      width: 150px;
    }

    .back-button:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(74, 105, 189, 0.4);
      background: linear-gradient(145deg, #7a99dc, #5a79cd);
    }

    .back-button:active {
      transform: translateY(1px);
      box-shadow: 0 2px 10px rgba(74, 105, 189, 0.2);
    }

    .container > div {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

  </style>
</head>
<body>
<div class="nav">
  <i class="fas fa-chess"></i>
  弈江湖五子棋对战
</div>
<div class="container">
  <div class="game-container">
    <!-- 棋盘区域 -->
    <canvas id="chess" width="450px" height="450px"></canvas>
    <!-- 显示区域 -->
    <div id="screen">等待玩家连接中</div>
  </div>
</div>
<script src="js/script.js"></script>
</body>
</html>